import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export type TypeData = {
	"0": string;
	动词?: string[];
	指示词?: string[];
	形容词?: string[];
	副词?: string[];
	名词?: string[];
	虚词?: string[];
	代词?: string[];
	关联?: string[];
};

export const keyData: Array<keyof Omit<TypeData, "0">> = [
	"动词",
	"名词",
	"指示词",
	"形容词",
	"副词",
	"虚词",
	"代词",
	"关联",
];

export interface IStore {
	data: TypeData[];
}

export default new Vuex.Store<IStore>({
	state: {
		data: [],
	},
	mutations: {
		setData(state: IStore, data: IStore["data"]) {
			state.data = data;
		},
	},
	actions: {},
	modules: {},
});
